package com.metal.gear.certification.entity.dto;

import com.metal.gear.certification.entity.po.SysRole;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.beans.BeanUtils;

@Data
@Schema(name ="角色保存和更新实体")
public class SysRoleSaveAndEditDto {

    @Schema(name ="角色id，roleId")
    private String id;

    @Schema(name ="角色名称")
    private String roleName;

    @Schema(name ="角色编码")
    private String roleCode;

    @Schema(name ="描述")
    private String description;

    public static SysRole translateTo(SysRoleSaveAndEditDto dto) {
        SysRole po = new SysRole();
        BeanUtils.copyProperties(dto, po);
        return po;
    }

}
